//
//  ToolBase.m
//  TQLSmartPen
//
//  Created by tql on 2017/11/3.
//  Copyright © 2017年 tqlZj. All rights reserved.
//

#import "ToolBase.h"

@implementation ToolBase

+ (instancetype)shareToolbase {
    
    static dispatch_once_t onceToken;
    static ToolBase *tool = nil;
    dispatch_once(&onceToken, ^{
        tool = [ToolBase new];
    });
    return tool;
}

- (instancetype)init {
    if (self = [super init]) {
        
    }
    return self;
}

- ( CGFloat)getLabelFitHeightWithFont:(UIFont *)font content:(NSString *)content width:(CGFloat)width {
    CGSize size = CGSizeMake(width, 100000010);
    NSDictionary *dic = [NSDictionary dictionaryWithObject:font forKey:NSFontAttributeName];
    CGRect rect = [content boundingRectWithSize:size options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
    return rect.size.height;
}
@end
